<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="javascript:;">上级消费机构管理</a></li>
			<li><a href="{:U('AdminSaleManager/add',array('id'=>empty($item['id'])?'':$item['id']))}" target="_self">添加上级消费机构</a></li>
		</ul>
        <form class="well form-search" method="post" action="{:U('AdminSaleManager/index')}">
            关键词：
            <input type="text" name="keyword" style="width: 200px;" value="{$keyword}" placeholder="请输入关键字...">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:U('AdminSaleManager/index')}">清空</a>
        </form>
		<form class="js-ajax-form" action="" method="post">

			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
                        <th width="50">上级消费机构名称</th>
                        <th width="50">当前余额</th>
                        <th width="50">赠送金额百分比</th>
                        <th width="50">操作时间</th>
						<th width="70">{:L('ACTIONS')}</th>
					</tr>
				</thead>
				<foreach name="list" item="vo">
				<if condition="$vo['delete_time']">
				<tr class="deleted">
				<else />
				<tr>
				</if>
                    <td><a href="javascript:click_to('{$vo.id}');"><b>{$vo.sale_manage_name}</b></a></td>
                    <td>{$vo.balance}</td>
                    <td>{$vo.give_percent}</td>
					<td>{$vo.create_time}</td>
					<td class="undeleted">
						<if condition="$vo['delete_time']">
							<a href='{:U("AdminSaleManager/overdelete",array("id"=>$vo["id"]))}'>彻底删除</a> |
							<a href='{:U("AdminSaleManager/restore",array("id"=>$vo["id"]))}'>恢复数据</a>
						<else />
							<if condition="$user_model == '8'">
								<a href="{:U('AdminSaleManager/recharge',array('id'=>$vo['id']))}">充值</a>
							</if>
							<if condition="$admin['id'] == 10">
								<a href="{:U('AdminSaleManager/recharge',array('id'=>$vo['id']))}">充值</a> |
								<a href="{:U('AdminSaleManager/refund',array('id'=>$vo['id']))}">退款</a> |
								<a href="{:U('AdminSaleManager/add',array('id'=>$vo['id']))}">{:L('EDIT')}</a> |
								<a href="{:U('AdminSaleManager/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:L('DELETE')}</a>
							</if>
						</if>
					</td>
				</tr>
				</foreach>

			</table>

			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		function refersh_window() {
			var refersh_time = getCookie('refersh_time');
			if (refersh_time == 1) {
				window.location = "{:U('AdminSaleManager/index',$formget)}";
			}
		}
		function click_to(id){
			var jumpto = "/index.php?g=Admin&m=AdminSale&a=index&s_smid="+id;
			window.location = jumpto;
		}
	</script>
</body>
</html>